package com.rois.librois.RoIS;


/**
* RoIS/_EventIFStub.java .
* IDL-to-Java コンパイラ (ポータブル), バージョン "3.1" で生成
* 生成元: RoIS_IDL.idl
* 2011年9月8日 0時05分18秒 JST
*/


/******************************************
* For Event Interface
******************************************/
public class _EventIFStub extends org.omg.CORBA.portable.ObjectImpl implements com.rois.librois.RoIS.EventIF
{

  public com.rois.librois.RoIS.ReturnCode_t subscribe (String servername, String event_type, String condition, org.omg.CORBA.StringHolder subscribe_id)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("subscribe", true);
                $out.write_string (servername);
                $out.write_string (event_type);
                com.rois.librois.RoIS.Condition_tHelper.write ($out, condition);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                subscribe_id.value = $in.read_string ();
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return subscribe (servername, event_type, condition, subscribe_id        );
            } finally {
                _releaseReply ($in);
            }
  } // subscribe

  public com.rois.librois.RoIS.ReturnCode_t unsubscribe (String servername, String subscribe_id)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("unsubscribe", true);
                $out.write_string (servername);
                $out.write_string (subscribe_id);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return unsubscribe (servername, subscribe_id        );
            } finally {
                _releaseReply ($in);
            }
  } // unsubscribe

  public com.rois.librois.RoIS.ReturnCode_t get_event_detail (String servername, String event_id, String condition, com.rois.librois.RoIS.ResultListHolder results)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("get_event_detail", true);
                $out.write_string (servername);
                $out.write_string (event_id);
                com.rois.librois.RoIS.Condition_tHelper.write ($out, condition);
                $in = _invoke ($out);
                com.rois.librois.RoIS.ReturnCode_t $result = com.rois.librois.RoIS.ReturnCode_tHelper.read ($in);
                results.value = com.rois.librois.RoIS.ResultListHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return get_event_detail (servername, event_id, condition, results        );
            } finally {
                _releaseReply ($in);
            }
  } // get_event_detail

  // Type-specific CORBA::Object operations
  private static String[] __ids = {
    "IDL:RoIS/EventIF:1.0"};

  public String[] _ids ()
  {
    return (String[])__ids.clone ();
  }

  private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  {
     String str = s.readUTF ();
     String[] args = null;
     java.util.Properties props = null;
     org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
   try {
     org.omg.CORBA.Object obj = orb.string_to_object (str);
     org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
     _set_delegate (delegate);
   } finally {
     orb.destroy() ;
   }
  }

  private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  {
     String[] args = null;
     java.util.Properties props = null;
     org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
   try {
     String str = orb.object_to_string (this);
     s.writeUTF (str);
   } finally {
     orb.destroy() ;
   }
  }
} // class _EventIFStub
